package com.example.common;

/**
 * @author littlehu
 * @data 2018/6/22 16:29
 * @Email 807115007@qq.com
 **/
public class ResultUtils {

    public static <T> BaseDto<T> success(T data){
        BaseDto<T> baseDto = new BaseDto<>();
        baseDto.setData(data);
        baseDto.setCode(0);
        baseDto.setMessage("成功");
        return baseDto;
    }

    public static BaseDto fail(int code , String message){
        BaseDto baseDto = new BaseDto();
        baseDto.setCode(code);
        baseDto.setMessage(message);
        return baseDto;
    }
}
